import Vue from 'vue'
import VueRouter from 'vue-router'
import Home from '../views/Home.vue'

Vue.use(VueRouter)

const routes = [
  {//首页
    path: '/',
    name: 'index',
    meta:{
      showTab:true
    },
    component: () => import(/* webpackChunkName: "about" */ '../views/index.vue')
  },
  {//登录页
    path: '/login',
    name: 'login',
    component: () => import(/* webpackChunkName: "about" */ '../views/login.vue')
  },
  {
    path: '/shop',
    name: 'shop',
    meta:{
      showTab:true
    },
    component: () => import(/* webpackChunkName: "about" */ '../views/shop.vue')
  },
  {
    path: '/sheep',
    name: 'sheep',
    meta:{
      showTab:true
    },
    component: () => import(/* webpackChunkName: "about" */ '../views/sheep.vue')
  },
  {
    path: '/cart',
    name: 'cart',
    meta:{
      showTab:true
    },
    component: () => import(/* webpackChunkName: "about" */ '../views/cart.vue')
  },
  {//我的页
    path: '/me',
    name: 'me',
    meta:{
    },
    component: () => import(/* webpackChunkName: "about" */ '../views/me.vue')
  },
  // {
  //   path: '/',
  //   name: 'Home',
  //   component: Home
  // },
  // {
  //   path: '/about',
  //   name: 'About',
  //   // route level code-splitting
  //   // this generates a separate chunk (about.[hash].js) for this route
  //   // which is lazy-loaded when the route is visited.
  //   component: () => import(/* webpackChunkName: "about" */ '../views/About.vue')
  // }
]

const router = new VueRouter({
  // mode: 'history',
  mode: 'hash',
  base: process.env.BASE_URL,
  routes
})

export default router
